tpaRequests = []
class tpa():
    def __init__(self, playersend, playerrecv, time):
        self.playersend = playersend
        self.playerrecv = playerrecv
        self.time = time
        self.start()
    def start(self):
        tellrawText(self.playersend, "§l§6Ritle§aBlock§r", "已向玩家 §l%s§r 发起传送请求, 对方有 §l%d§r 秒的时间接受请求." % (self.playerrecv, self.time))
        tellrawText(self.playerrecv, "§l§6Ritle§aBlock§r", "收到 §l%s§r 发来的传送请求, 你有 §l%d§r 秒的时间接受请求." % (self.playersend, self.time))
        tpaRequests.append(self)
    def accept(self):
        sendcmd("/tp %s %s" % (self.playersend, self.playerrecv))
        tellrawText(self.playersend, "§l§6Ritle§aBlock§r", "§l%s§r 已接受你的传送请求." % self.playerrecv)
        tellrawText(self.playerrecv, "§l§6Ritle§aBlock§r", "你已接受 §l%s§r 的传送请求." % self.playersend)
        tpaRequests.remove(self)
    def decline(self):
        tellrawText(self.playersend, "§l§6Ritle§aBlock§r", "§c§l%s§r§c 已拒绝你的传送请求." % self.playerrecv)
        tellrawText(self.playerrecv, "§l§6Ritle§aBlock§r", "§c你已拒绝 §l%s§r§c 的传送请求." % self.playersend)
        tpaRequests.remove(self)
    def outdate(self):
        tellrawText(self.playersend, "§l§6Ritle§aBlock§r", "§c你发给 §l%s§r§c 的传送请求已过期." % self.playerrecv)
        tellrawText(self.playerrecv, "§l§6Ritle§aBlock§r", "§c§l%s§r§c 发来的传送请求已过期." % self.playersend)
        tpaRequests.remove(self)
